import request from '@/utils/request'

// 更新用户信息
const updateUserInfoAPI = (userForm) => {
  return request({
    method: 'put',
    url: '/my/userinfo',
    data: userForm
  })
}

// 更新用户头像
const updateUserAvatarAPI = (avatarStr) => {
  return request({
    method: 'patch',
    url: '/my/update/avatar',
    data: {
      avatar: avatarStr
    }
  })
}

// 更新密码
const updatePwdAPI = (pwdForm) => {
  return request({
    method: 'patch',
    url: '/my/updatepwd',
    data: pwdForm
  })
}

export {
  updateUserInfoAPI,
  updateUserAvatarAPI,
  updatePwdAPI
}
